<template>
    <div class="bread-crumb">
         <el-breadcrumb separator="/">
            <el-breadcrumb-item v-for="(item,index)  in levelList" :key="item.path" v-show="item.meta.title">
                <span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{item.meta.title}}</span>
                <router-link v-else :to="{ name: item.name }">{{item.meta.title}}</router-link>
            </el-breadcrumb-item>
        </el-breadcrumb>
    </div>
</template>
<script>
export default {
    data() {
        return {
            levelList: null
        };
    },
    created() {
        this.getBreadcrumb();
    },
    methods: {
        getBreadcrumb() {
            this.levelList = this.$route.matched;
        }
     },
}
</script>
<style lang="scss" scoped>
@include component(bread-crumb){
    margin-right: 15px;
}
</style>
